|
- This ADC/Digital unit is controlled by three bytes sent via RS232.
- The first byte is a leader character. It is '$' (ASCII
036).
- The second byte is the unit address and ADC channel select,
whose bits are configured as:
- The third byte is the digital value to be sent out Port C,
whose bits are configured as:
- A0, C0, and D0 are least significant bits.
- If the second and third bytes are not each received within one
second, the software resets to look for the '$' leader byte
again.
- Upon successfully receiving the three bytes, the digital value is
placed on Port C, an ADC conversion is done and the ADC value is
returned at 9600 baud.
- The LED flashes once after initialization, and also when the
measurement is done.
- The serial Tx output floats when high, and is 0V when low. This
allows paralleling several of these units on the same Rx and Tx line on
the TTL side of the MAX235 RS232 converter. The Tx line must have
a pullup resistor. However, only one pullup resistor and
one MAX235 is required regardless of the number of units
connected.
- The ADC value is returned as four characters (0000-1023) followed by
a trailing CR/LF. D0 is the least significant digit, as illustrated in
the following:
- If leading zeros are not desired tie NO ZEROS low.
|